<?php
/**
 * polwebgis
 * 
 * This file is part of polwebgis.
 *
 * @copyright   Copyright (c) 2012 Dominik Janisch (http://www.joanneum.at)
 * @lastmodified    $LastChangedDate: 2012-03-07 09:15:12 +0000 (Wed, 07 Mar 2012) $
 * @revision    $Revision: 160 $ 
 */


class Debugger
{  

    public function __construct(){}
        
    public function __destruct(){}
    
    public function write($message)
    {
        $message = date("d.m.Y - H:i") . " - " . $message . "\n";
        if(is_writable(DEBUGGER_PATH)) 
        {
            if(!$handle = fopen(DEBUGGER_PATH, "a")) 
            {
                 print "Unable to open ".DEBUGGER_PATH;
                 exit;
            }
            if(!fwrite($handle, $message)) 
            {
                print "Unable to write to ".DEBUGGER_PATH;
                exit;
            }
            fclose($handle);
        }
        else
            print DEBUGGER_PATH." is not writeable";    
    }
}


?>